import { getCategoryList } from '../../../services/good/fetchCategoryList';
import { request } from '../../../services/_utils/util';
const api = require('../../../services/config/api');

Page({
  data: {
    list: [],
    placeId: wx.getStorageSync('placeId'),
  },
  async init() {
    try {
      var that = this;
      this.setData({
        placeId: wx.getStorageSync('placeId'),
      });
      request(api.Classifydata + '?placeId=' + this.data.placeId).then((res) => {
        console.log(res);
        if (res.code == 200) {
          that.setData({
            list: res.data,
          });
        }
      });
    } catch (error) {
      console.error('err:', error);
    }
  },

  onShow() {
    this.init();
    this.getTabBar().init();
  },
  onChange() {
    console.log(3333);
    wx.navigateTo({
      url: '/pages/goods/list/index',
    });
  },
  onLoad() {},
  Classifydata() {},
});
